package com.zcckj.demo.order.controller;

import com.zcckj.demo.order.model.dto.OrderDTO;
import com.zcckj.demo.order.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 *
 * <p>
 *  TODO 类作用描述
 * </p>
 *
 * @author zhangjie
 * @since 2019-08-27
 */
@RestController
@RequestMapping("/order")
public class OrderController {
    @Autowired
    private OrderService orderService;

    @PostMapping("/create")
    public Boolean createOrder(@RequestBody @Validated OrderDTO orderDTO) {
        return orderService.saveOrder(orderDTO);
    }
}
